home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / rawstat / rawproc.c < prev    next >
C/C++ Source or Header  |  1990-09-24  |  3KB  |  95 lines

  1. /* 
  2.  * rawproc.c --
  3.  *
  4.  *    Print raw format PROC statistics.
  5.  *
  6.  * Copyright (C) 1986 Regents of the University of California
  7.  * All rights reserved.
  8.  */
  9.  
  10. #ifndef lint
  11. static char rcsid[] = "$Header: /sprite/src/cmds/rawstat/RCS/rawproc.c,v 1.3 90/09/24 14:40:31 douglis Exp $ SPRITE (Berkeley)";
  12. #endif not lint
  13.  
  14. #include "sprite.h"
  15. #include "stdio.h"
  16. #include "sysStats.h"
  17. #include "kernel/procMigrate.h"
  18.  
  19.  
  20. /*
  21.  *----------------------------------------------------------------------
  22.  *
  23.  * PrintRawProcMigStat --
  24.  *
  25.  *    Prints proc_MigStats.
  26.  *
  27.  * Results:
  28.  *    None.
  29.  *
  30.  * Side effects:
  31.  *    None.
  32.  *
  33.  *----------------------------------------------------------------------
  34.  */
  35.  
  36. PrintRawProcMigStat()
  37. {
  38.     Proc_MigStats stats;        /* statistics buffer */
  39.     Proc_MigStats *X = &stats;
  40.     int status;
  41.  
  42.     /*
  43.      * Get a copy of the trace table.  Make sure it's zeroed in case the
  44.      * kernel provides us with a shorter (older) structure.
  45.      */
  46.  
  47.     bzero((Address) &stats, sizeof(stats));
  48.     status = Sys_Stats(SYS_PROC_MIGRATION, SYS_PROC_MIG_GET_STATS,
  49.                (Address) &stats);
  50.     if (status != SUCCESS) {
  51.     return;
  52.     }
  53.     if (stats.statsVersion != PROC_MIG_STATS_VERSION) {
  54.     return;
  55.     }
  56.  
  57.     printf("proc_MigStats\n");
  58.  
  59.  
  60.     ZeroPrint("statsVersion   %8u\n", X->statsVersion);
  61.     ZeroPrint("foreign        %8u\n", X->foreign);
  62.     ZeroPrint("remote         %8u\n", X->remote);
  63.     ZeroPrint("exports        %8u\n", X->exports);
  64.     ZeroPrint("execs          %8u\n", X->execs);
  65.     ZeroPrint("imports        %8u\n", X->imports);
  66.     ZeroPrint("errors         %8u\n", X->errors);
  67.     ZeroPrint("evictions      %8u\n", X->varStats.evictions);
  68.     ZeroPrint("evictions:squared      %8u\n", X->squared.evictions);
  69.     ZeroPrint("returns        %8u\n", X->returns);
  70.     ZeroPrint("pagesWritten   %8u\n", X->varStats.pagesWritten);
  71.     ZeroPrint("pagesWritten:squared   %8u\n", X->squared.pagesWritten);
  72.  
  73.     ZeroPrint("timeToMigrate  %8u\n", X->varStats.timeToMigrate);
  74.     ZeroPrint("timeToMigrate:squared  %8u\n", X->squared.timeToMigrate);
  75.     ZeroPrint("timeToExec     %8u\n", X->varStats.timeToExec);
  76.     ZeroPrint("timeToExec:squared     %8u\n", X->squared.timeToExec);
  77.     ZeroPrint("timeToEvict    %8u\n", X->varStats.timeToEvict);
  78.     ZeroPrint("timeToEvict:squared    %8u\n", X->squared.timeToEvict);
  79.     ZeroPrint("totalEvictTime    %8u\n", X->varStats.totalEvictTime);
  80.     ZeroPrint("totalEvictTime:squared    %8u\n", X->squared.totalEvictTime);
  81.     ZeroPrint("totalCPUTime   %8u\n", X->varStats.totalCPUTime);
  82.     ZeroPrint("totalCPUTime:squared   %8u\n", X->squared.totalCPUTime);
  83.     ZeroPrint("remoteCPUTime  %8u\n", X->varStats.remoteCPUTime);
  84.     ZeroPrint("remoteCPUTime:squared  %8u\n", X->squared.remoteCPUTime);
  85.     ZeroPrint("evictionCPUTime  %8u\n", X->varStats.evictionCPUTime);
  86.     ZeroPrint("evictionCPUTime:squared  %8u\n", X->squared.evictionCPUTime);
  87.     ZeroPrint("rpcKbytes      %8u\n", X->varStats.rpcKbytes);
  88.     ZeroPrint("rpcKbytes:squared      %8u\n", X->squared.rpcKbytes);
  89.     ZeroPrint("migrationsHome %8u\n", X->migrationsHome);
  90.     ZeroPrint("evictCalls     %8u\n", X->evictCalls);
  91.     ZeroPrint("evictsNeeded   %8u\n", X->evictsNeeded);
  92.     ZeroPrint("evictionsToUs   %8u\n", X->evictionsToUs);
  93.     ZeroPrint("processes   %8u\n", X->processes);
  94. }
  95.